import datetime
import os
import re

or_file = open('/home/chen/data/KT02/timestamps.txt', 'r')
tm_file = open('/home/chen/data/KT02/timestamps_new.txt', 'w')

for line in or_file.readlines():
    element = datetime.datetime.strptime(line[:-4], "%Y-%m-%d %H:%M:%S.%f")
    tm_file.write( str(int(element.timestamp()*1e6)) + "\n")
    
